package com.wsdcd.zlg.sb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
public class Test {
    @ResponseBody
    @RequestMapping("test")
    public String Test1(){
        return "hello world";
    }

    @RequestMapping("test2")
    public String Test2(Model model){
        String username = "admin";
        String password = "root";
        model.addAttribute("username",username);
        model.addAttribute("password",password);
        model.addAttribute("nowDate",new Date());
        return "test/test2";
    }
}
